Repository navigation
fix(research): preserve disabled reasoning during structured retries - #3134
Conversation
ZQR1101
left a comment
There was a problem hiding this comment.
Reviewed at 2a174da against current dev (76dc7e2).
The rule is right: a structured retry may lower thinking, but it must not switch it back on. The easy thing to break here is the unset case, and you did not break it — normalize_reasoning_effort(None) returns None, which is not in THINKING_OFF_EFFORTS, so a turn that never chose a level still falls through to RETRY_REASONING_EFFORT and the retry keeps lowering from the provider default. Only an explicit none/minimal/minimum is preserved.
Evidence:
- The new test on
dev: 6 of the 8 parametrizations fail (the three DashScope off levels across both outline paths) and the 2 GPT-5 controls pass; merged, all 8 pass. Withtests/services/llm/test_reasoning_params.py: 59 passed. tests/agents/research,tests/services/llm,tests/agents/question: byte-identical FAILED list before and after this PR (32 pre-existing failures on this host), passed 1162 -> 1170, exactly the 8 new cases.- Both outline paths do go through
_completion_kwargs, so #3133's research symptom is fully covered, andRefsrather thanClosesis correct. - CI on this HEAD: all checks success, browser acceptance skipped.
Non-blocking, but worth a follow-up issue: deeptutor/agents/question/pipeline.py has the same reasoning_effort or self.reasoning_effort helper (still carrying the comment this PR replaces here) with the same retry sites, so a thinking-off question turn still gets thinking re-enabled on retry. deeptutor/services/llm/structured_retry.py describes itself as the project's single rule for this, so pushing the guard into build_completion_kwargs, or one shared helper, would fix all three pipelines at once and let the duplicate frozenset in provider_core/anthropic_provider.py collapse into THINKING_OFF_EFFORTS.
Merging.
|
Thanks for reviewing this and verifying both outline paths against |
What changed
Keep the caller's explicit low or disabled reasoning setting when research decomposition or report-outline generation retries after a structured output failure. A retry still lowers high reasoning to low when the caller has not already set a lower level.
Refs #3133.
Verification